Apple, the Apple logo, and Macintosh are registered trademarks of Apple Computer, Inc.
Mac and OpenDoc are trademarks of Apple Computer, Inc.
Introduction
One of the items in the OpenDoc “Edit” menu is “… Info…” which a user chooses if they want to get information about the selection like its name, kind, category, mod/creation dates, comments, etc. This recipes serves as sample code to do this.
Description
When an embedded part is selected, the active part should set the name of the “Info…” menu item to “Part Info…”, and selecting the command should bring up the PartFrameInfo dialog on that selected part. When a link border is selected, the active part should set the name of the “Info…” menu item to “Link Info…”, and selecting the command should bring up the appropriate LinkInfo dialog. If some native content is selected, and the active part supports an Info dialog of its own on that selected content, then it should set the name of the “Info…” menu item appropriately: “<mycontent> Info…” and display the appropriate dialog when the command is selected. If there is no selection, the name of the “Info…” menu item should be set to “Part Info…” and the item disabled.
Changes since November, 1994
• The recipe for handling the results of ShowLinkSourceInfo has changed slightly. It is not necessary for the part to check for a change to the autoUpdate setting if infoAction.action is kODLinkInfoUpdateNow. If the send updates setting is changed to automatic, the Update Now button is disabled. If the send updates setting is changed to manual, the link should already be up to date.
Caveats
• This sample uses a private field fSelection which keeps track of the selection in a part specific manner. For simplicity’s sake, we assume fSelection is an object which supports a few boolean methods regarding the nature of the selection.
• If the part editor does not support linking, then it can ignore the Link Info cases.
• If the part editor does support linking, the LinkBroken method notifies the selection that the content is no longer linked, the
UpdateSelectedLinks method causes source content to update a link and destination content to be replaced by the current link content, and the GetContentChangeID method returns the change id associated with the selected link content.
• If the part editor does not support embedding or linking, and does not support Info on any native content, then it should always set the menu item to "Part Info…" and disable it.